package com.ftaillefer.rss.model;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

import com.ftaillefer.rss.enums.Day;

/*
 * Stores an RSS feed
 */
public class Channel {

	private Category category;
	private String cloud;
	private String copyright;
	private String description;
	private String docs;
	private String generator;
	private Image image;
	private List<Item> items;
	private String language;
	private String lastBuildDate;
	private String link;
	private String managingEditor;
	private String pubDate;
	private String rating;
	private Day[] skipDays;
	private List<Short> skipHours;
	private String title;
	private String ttl;
	private String webMaster;
	private String url;

	public Channel() {
		skipHours = new ArrayList<Short>();
		items = new ArrayList<Item>();
	}

	public Channel(Category category, String cloud, String copyright,
			String description, String docs, String generator, Image image,
			List<Item> items, String language, String lastBuildDate,
			String link, String managingEditor, String pubDate, String rating,
			Day[] skipDays, List<Short> skipHours, String title, String ttl,
			String webMaster, String url) {
		super();
		this.category = category;
		this.cloud = cloud;
		this.copyright = copyright;
		this.description = description;
		this.docs = docs;
		this.generator = generator;
		this.image = image;
		this.items = items;
		this.language = language;
		this.lastBuildDate = lastBuildDate;
		this.link = link;
		this.managingEditor = managingEditor;
		this.pubDate = pubDate;
		this.rating = rating;
		this.skipDays = skipDays;
		this.skipHours = skipHours;
		this.title = title;
		this.ttl = ttl;
		this.webMaster = webMaster;
		this.url = url;
	}

	public void addItem(Item item) {
		if (this.items == null)
			this.items = new ArrayList<Item>();
		this.items.add(item);
	}

	public Category getCategory() {
		return category;
	}

	public void setCategory(Category category) {
		this.category = category;
	}

	public void setCloud(String cloud) {
		this.cloud = cloud;
	}

	public void setCopyright(String copyright) {
		this.copyright = copyright;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public void setDocs(String docs) {
		this.docs = docs;
	}

	public void setGenerator(String generator) {
		this.generator = generator;
	}

	public void setImage(Image image) {
		this.image = image;
	}

	public void setLanguage(String language) {
		this.language = language;
	}

	public void setLastBuildDate(String lastBuildDate) {
		this.lastBuildDate = lastBuildDate;
	}

	public void setLink(String link) {
		this.link = link;
	}

	public void setManagingEditor(String managingEditor) {
		this.managingEditor = managingEditor;
	}

	public void setPubDate(String pubDate) {
		this.pubDate = pubDate;
	}

	public void setRating(String rating) {
		this.rating = rating;
	}

	public void setSkipDays(Day[] skipDays) {
		this.skipDays = skipDays;
	}

	public void setSkipHours(List<Short> skipHours) {
		this.skipHours = skipHours;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public void setTtl(String ttl) {
		this.ttl = ttl;
	}

	public void setWebMaster(String webMaster) {
		this.webMaster = webMaster;
	}

	public String getCloud() {
		return cloud;
	}

	public String getCopyright() {
		return copyright;
	}

	public String getDescription() {
		return description;
	}

	public String getDocs() {
		return docs;
	}

	public String getGenerator() {
		return generator;
	}

	public Image getImage() {
		return image;
	}

	public List<Item> getItems() {
		return items;
	}

	public String getLanguage() {
		return language;
	}

	public String getLastBuildDate() {
		return lastBuildDate;
	}

	public String getLink() {
		return link;
	}

	public String getManagingEditor() {
		return managingEditor;
	}

	public String getPubDate() {
		return pubDate;
	}

	public String getRating() {
		return rating;
	}

	public Day[] getSkipDays() {
		return skipDays;
	}

	public List<Short> getSkipHours() {
		return skipHours;
	}

	public String getTitle() {
		return title;
	}

	public String getTtl() {
		return ttl;
	}

	public String getWebMaster() {
		return webMaster;
	}

	public void setItems(List<Item> items) {
		this.items = items;
	}

	@Override
	public String toString() {
		return "Channel [category=" + category + ", cloud=" + cloud
				+ ", copyright=" + copyright + ", description=" + description
				+ ", docs=" + docs + ", generator=" + generator + ", image="
				+ image + ", items=" + items + ", language=" + language
				+ ", lastBuildDate=" + lastBuildDate + ", link=" + link
				+ ", managingEditor=" + managingEditor + ", pubDate=" + pubDate
				+ ", rating=" + rating + ", skipDays="
				+ Arrays.toString(skipDays) + ", skipHours=" + skipHours
				+ ", title=" + title + ", ttl=" + ttl + ", webMaster="
				+ webMaster + ", url=" + url + "]";
	}

	public String getUrl() {
		return url;
	}

	public void setUrl(String url) {
		this.url = url;
	}

}
